#include <QtGui>
#include "regionDialog.h"

RegionDialog::RegionDialog(QWidget *parent) : QTableWidget(parent) {

//Кодек для руссификации
  russianCodec = QTextCodec::codecForName("UTF-8");
  QTextCodec::setCodecForTr(russianCodec);
  QTextCodec::setCodecForCStrings(russianCodec);

//Установки для окна
  this->setWindowTitle(tr("Выбор типа поверхности"));
  this->setFixedSize(WREGION, HREGION);
  // this->resize(WREGION, HREGION);

  this->verticalHeader()->hide();
  this->horizontalHeader()->setEnabled(false);
  this->setColumnCount(5);
  this->setRowCount(47);

  this->horizontalHeader()->setResizeMode(0, QHeaderView::Fixed);
  this->horizontalHeader()->setResizeMode(1, QHeaderView::Fixed);
  this->horizontalHeader()->setResizeMode(2, QHeaderView::Fixed);
  this->horizontalHeader()->setResizeMode(3, QHeaderView::Fixed);
  this->horizontalHeader()->setResizeMode(4, QHeaderView::Stretch);


  curSelRow = DEFREGION;

  //Задает имена колонкам в таблице переменных
  nameColumn = new QTableWidgetItem();
  nameColumn->setText(tr("Регион"));
  nameColumn->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
  this->setHorizontalHeaderItem(0, nameColumn);

  QString itemStr("");
  itemStr += QChar(956);
  itemStr += " (P ";
  itemStr += QChar(8805);
  itemStr += " 1)";

  nameColumn = new QTableWidgetItem();
  nameColumn->setText(itemStr);
  nameColumn->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
  this->setHorizontalHeaderItem(1, nameColumn);

  itemStr  =  "";
  itemStr += QChar(956);
  itemStr += " (P < 1)";

  nameColumn = new QTableWidgetItem();
  nameColumn->setText(itemStr);
  nameColumn->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
  this->setHorizontalHeaderItem(2, nameColumn);

  nameColumn = new QTableWidgetItem();
  nameColumn->setText(tr("Mr"));
  nameColumn->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
  this->setHorizontalHeaderItem(3, nameColumn);

  nameColumn = new QTableWidgetItem();
  
  nameColumn->setText(QChar(947));
  nameColumn->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
  this->setHorizontalHeaderItem(4, nameColumn);

  this->setColumnWidth(0, WREGION-295);
  this->setColumnWidth(1, 80);
  this->setColumnWidth(2, 70);
  this->setColumnWidth(3, 60);
  // this->setColumnWidth(4, 60);

  for (int i=0; i < MAXITEMS; i++)
    for (int j=0; j < MAXITEMS; j++)
      items[i][j] = NULL;

//   bigPeriod = true;

//СОЗДАНИЕ ЭЛЕМЕНТОВ

  int curRow;

//1
  curRow = 0;

  createItem(curRow, 0, tr("Побережья Белого и Баренцева морей"), false);

  createItem(curRow, 1, "0.4", true);
  createItem(curRow, 2, "0.35", true);
  createItem(curRow, 3, "130", true);
  createItem(curRow, 4, "1.33", true);

  this->setRowHeight(curRow, 25);

//2
  curRow = 1;

  createItem(curRow, 0, tr("Север европейской части СССР и Западной Сибири"), false);

  createItem(curRow, 1, "0.62", true);
  createItem(curRow, 2, "0.48", true);
  createItem(curRow, 3, "120", true);
  createItem(curRow, 4, "1.33", true);

  this->setRowHeight(curRow, 25);

//3
  curRow = 2;

  createItem(curRow, 0, tr("Равнинные области запада и центра европейской части СССР"), false);

  createItem(curRow, 1, "0.71", true);
  createItem(curRow, 2, "0.59", true);
  createItem(curRow, 3, "150", true);
  createItem(curRow, 4, "1.54", true);

  this->setRowHeight(curRow, 25);

//4
  curRow = 3;

  createItem(curRow, 0, tr("Равнинные области Украины"), false);

  createItem(curRow, 1, "0.71", true);
  createItem(curRow, 2, "0.64", true);
  createItem(curRow, 3, "110", true);
  createItem(curRow, 4, "1.54", true);

  this->setRowHeight(curRow, 25);

//5
  curRow = 4;

  createItem(curRow, 0, tr("Возвышенности европейской части СССР. Западный склон Урала"), false);

  createItem(curRow, 1, "0.71", true);
  createItem(curRow, 2, "0.71", true);
  createItem(curRow, 3, "150", true);
  createItem(curRow, 4, "1.54", true);

  this->setRowHeight(curRow, 25);

//6
  curRow = 5;

  createItem(curRow, 0, tr("Восток Украины, низовье Волги и Дона, Южный Крым"), false);

  createItem(curRow, 1, "0.67", true);
  createItem(curRow, 2, "0.57", true);
  createItem(curRow, 3, "60", true);
  createItem(curRow, 4, "1.82", true);

  this->setRowHeight(curRow, 25);

//7
  curRow = 6;

  createItem(curRow, 0, tr("Нижнее Поволжье"), false);

  createItem(curRow, 1, "0.66", true);
  createItem(curRow, 2, "0.66", true);
  createItem(curRow, 3, "50", true);
  createItem(curRow, 4, "2", true);

  this->setRowHeight(curRow, 25);

//8
  curRow = 7;

  createItem(curRow, 0, tr("Наветренные склоны возвышенностей европейской части СССР"), false);

  createItem(curRow, 1, "0.7", true);
  createItem(curRow, 2, "0.66", true);
  createItem(curRow, 3, "70", true);
  createItem(curRow, 4, "1,54", true);

  this->setRowHeight(curRow, 25);

//9
  curRow = 8;

  createItem(curRow, 0, tr("Северное Предкавказье"), false);

  createItem(curRow, 1, "0.7", true);
  createItem(curRow, 2, "0.66", true);
  createItem(curRow, 3, "70", true);
  createItem(curRow, 4, "1,54", true);

  this->setRowHeight(curRow, 25);

//10
  curRow = 9;

  createItem(curRow, 0, tr("Ставропольская возвышенность"), false);

  createItem(curRow, 1, "0.63", true);
  createItem(curRow, 2, "0.56", true);
  createItem(curRow, 3, "100", true);
  createItem(curRow, 4, "1,82", true);

  this->setRowHeight(curRow, 25);

//11
  curRow = 10;

  createItem(curRow, 0, tr("Северные предгорья Большого Кавказа"), false);

  createItem(curRow, 1, "0.63", true);
  createItem(curRow, 2, "0.56", true);
  createItem(curRow, 3, "100", true);
  createItem(curRow, 4, "1,82", true);

  this->setRowHeight(curRow, 25);

//12
  curRow = 11;

  createItem(curRow, 0, tr("Северный склон Большого Кавказа"), false);

  createItem(curRow, 1, "0.63", true);
  createItem(curRow, 2, "0.56", true);
  createItem(curRow, 3, "100", true);
  createItem(curRow, 4, "1,82", true);

  this->setRowHeight(curRow, 25);

//13
  curRow = 12;

  createItem(curRow, 0, tr("Южная часть Западной Сибири, среднее течение р. Или"), false);

  createItem(curRow, 1, "0.72", true);
  createItem(curRow, 2, "0.58", true);
  createItem(curRow, 3, "80", true);
  createItem(curRow, 4, "1,54", true);

  this->setRowHeight(curRow, 25);

//14
  curRow = 13;

  createItem(curRow, 0, tr("Район оз. Але-Куль"), false);

  createItem(curRow, 1, "0.72", true);
  createItem(curRow, 2, "0.58", true);
  createItem(curRow, 3, "80", true);
  createItem(curRow, 4, "1,54", true);

  this->setRowHeight(curRow, 25);

//15
  curRow = 14;

  createItem(curRow, 0, tr("Центральный и Северо-Восточный Казахстан, предгорья Алтая"), false);

  createItem(curRow, 1, "0.74", true);
  createItem(curRow, 2, "0.66", true);
  createItem(curRow, 3, "80", true);
  createItem(curRow, 4, "1,82", true);

  this->setRowHeight(curRow, 25);

//16
  curRow = 15;

  createItem(curRow, 0, tr("Северные склоны Западных Саян, Заилийского Алатау"), false);

  createItem(curRow, 1, "0.57", true);
  createItem(curRow, 2, "0.57", true);
  createItem(curRow, 3, "80", true);
  createItem(curRow, 4, "1,33", true);

  this->setRowHeight(curRow, 25);

//17
  curRow = 16;

  createItem(curRow, 0, tr("Джунгарский Алатау, Кузнецкий Алатау, Алтай"), false);

  createItem(curRow, 1, "0.61", true);
  createItem(curRow, 2, "0.48", true);
  createItem(curRow, 3, "140", true);
  createItem(curRow, 4, "1,33", true);

  this->setRowHeight(curRow, 25);

//18
  curRow = 17;

  createItem(curRow, 0, tr("Северный склон Западный Саян"), false);

  createItem(curRow, 1, "0.49", true);
  createItem(curRow, 2, "0.33", true);
  createItem(curRow, 3, "100", true);
  createItem(curRow, 4, "1,54", true);

  this->setRowHeight(curRow, 25);

//19
  curRow = 18;

  createItem(curRow, 0, tr("Средняя Сибирь"), false);

  createItem(curRow, 1, "0.69", true);
  createItem(curRow, 2, "0.47", true);
  createItem(curRow, 3, "130", true);
  createItem(curRow, 4, "1,54", true);

  this->setRowHeight(curRow, 25);

//20
  curRow = 19;

  createItem(curRow, 0, tr("Хребет Хамар-Дабан"), false);

  createItem(curRow, 1, "0.48", true);
  createItem(curRow, 2, "0.35", true);
  createItem(curRow, 3, "130", true);
  createItem(curRow, 4, "1,82", true);

  this->setRowHeight(curRow, 25);

//21
  curRow = 20;

  createItem(curRow, 0, tr("Восточная Сибирь"), false);

  createItem(curRow, 1, "0.6", true);
  createItem(curRow, 2, "0.52", true);
  createItem(curRow, 3, "90", true);
  createItem(curRow, 4, "1,54", true);

  this->setRowHeight(curRow, 25);

//22
  curRow = 21;

  createItem(curRow, 0, tr("Бассейны Шилки и Аргуни, долина Среднего Амура"), false);

  createItem(curRow, 1, "0.65", true);
  createItem(curRow, 2, "0.54", true);
  createItem(curRow, 3, "100", true);
  createItem(curRow, 4, "1,54", true);

  this->setRowHeight(curRow, 25);

//23
  curRow = 22;

  createItem(curRow, 0, tr("Бассейны Колымы и рек Охотского моря"), false);

  createItem(curRow, 1, "0.36", true);
  createItem(curRow, 2, "0.48", true);
  createItem(curRow, 3, "100", true);
  createItem(curRow, 4, "1,54", true);

  this->setRowHeight(curRow, 25);

//24
  curRow = 23;

  createItem(curRow, 0, tr("Северная часть Нижнеамурской неизменности"), false);

  createItem(curRow, 1, "0.36", true);
  createItem(curRow, 2, "0.48", true);
  createItem(curRow, 3, "100", true);
  createItem(curRow, 4, "1,54", true);

  this->setRowHeight(curRow, 25);

//25
  curRow = 24;

  createItem(curRow, 0, tr("Побережье Охотского моря, бассейны рек Берингова моря"), false);

  createItem(curRow, 1, "0.35", true);
  createItem(curRow, 2, "0.31", true);
  createItem(curRow, 3, "80", true);
  createItem(curRow, 4, "1,54", true);

  this->setRowHeight(curRow, 25);

//26
  curRow = 25;

  createItem(curRow, 0, tr("Центр и запад Камчатки"), false);

  createItem(curRow, 1, "0.35", true);
  createItem(curRow, 2, "0.31", true);
  createItem(curRow, 3, "80", true);
  createItem(curRow, 4, "1,54", true);

  this->setRowHeight(curRow, 25);

//27
  curRow = 26;

  QString str("Восточное побережье Камчатки южнее 56");
  str += QChar(176);
  str += " с.ш.";

  createItem(curRow, 0, str, false);

  createItem(curRow, 1, "0.28", true);
  createItem(curRow, 2, "0.26", true);
  createItem(curRow, 3, "110", true);
  createItem(curRow, 4, "1,54", true);

  this->setRowHeight(curRow, 25);

//28
  curRow = 27;

  createItem(curRow, 0, tr("Побережье Татарского пролива"), false);

  createItem(curRow, 1, "0.35", true);
  createItem(curRow, 2, "0.28", true);
  createItem(curRow, 3, "110", true);
  createItem(curRow, 4, "1,54", true);

  this->setRowHeight(curRow, 25);

//29
  curRow = 28;

  createItem(curRow, 0, tr("Район оз. Ханка"), false);

  createItem(curRow, 1, "0.65", true);
  createItem(curRow, 2, "0.57", true);
  createItem(curRow, 3, "90", true);
  createItem(curRow, 4, "1,54", true);

  this->setRowHeight(curRow, 25);

//30
  curRow = 29;

  createItem(curRow, 0, tr("Бассейны рек Японского моря, о. Сахалин, Курильские о-ва"), false);

  createItem(curRow, 1, "0.45", true);
  createItem(curRow, 2, "0.44", true);
  createItem(curRow, 3, "110", true);
  createItem(curRow, 4, "1,54", true);

  this->setRowHeight(curRow, 25);

//31
  curRow = 30;

  createItem(curRow, 0, tr("Юг Казахстана, равнина Средней Азии и склоны гор до 1500м"), false);

  createItem(curRow, 1, "0.44", true);
  createItem(curRow, 2, "0.4", true);
  createItem(curRow, 3, "40", true);
  createItem(curRow, 4, "1,82", true);

  this->setRowHeight(curRow, 25);

//32
  curRow = 31;

  createItem(curRow, 0, tr("Бассейн оз.Иссык-Куль до 2500м"), false);

  createItem(curRow, 1, "0.44", true);
  createItem(curRow, 2, "0.4", true);
  createItem(curRow, 3, "40", true);
  createItem(curRow, 4, "1,82", true);

  this->setRowHeight(curRow, 25);

//33
  curRow = 32;

  createItem(curRow, 0, tr("Склоны гор Средней Азии на высоте 1500-3000м"), false);

  createItem(curRow, 1, "0.41", true);
  createItem(curRow, 2, "0.37", true);
  createItem(curRow, 3, "40", true);
  createItem(curRow, 4, "1,54", true);

  this->setRowHeight(curRow, 25);

//34
  curRow = 33;

  createItem(curRow, 0, tr("Юго-Западная Туркмения"), false);

  createItem(curRow, 1, "0.49", true);
  createItem(curRow, 2, "0.32", true);
  createItem(curRow, 3, "20", true);
  createItem(curRow, 4, "1,54", true);

  this->setRowHeight(curRow, 25);

//35
  curRow = 34;

  createItem(curRow, 0, tr("Черноморское побережье"), false);

  createItem(curRow, 1, "0.62", true);
  createItem(curRow, 2, "0.58", true);
  createItem(curRow, 3, "90", true);
  createItem(curRow, 4, "1,54", true);

  this->setRowHeight(curRow, 25);

//36
  curRow = 35;

  createItem(curRow, 0, tr("Западный склон Большого Кавказа до Сухуми"), false);

  createItem(curRow, 1, "0.62", true);
  createItem(curRow, 2, "0.58", true);
  createItem(curRow, 3, "90", true);
  createItem(curRow, 4, "1,54", true);

  this->setRowHeight(curRow, 25);

//37
  curRow = 36;

  createItem(curRow, 0, tr("Побережье Каспийского моря и равнина от Махачкалы до Баку"), false);

  createItem(curRow, 1, "0.51", true);
  createItem(curRow, 2, "0.43", true);
  createItem(curRow, 3, "60", true);
  createItem(curRow, 4, "1,82", true);

  this->setRowHeight(curRow, 25);

//38
  curRow = 37;

  createItem(curRow, 0, tr("Восточный склон Большого Кавказа"), false);

  createItem(curRow, 1, "0.58", true);
  createItem(curRow, 2, "0.47", true);
  createItem(curRow, 3, "70", true);
  createItem(curRow, 4, "1,82", true);

  this->setRowHeight(curRow, 25);

//39
  curRow = 38;

  createItem(curRow, 0, tr("Кура-Араксинская низменность до 500м"), false);

  createItem(curRow, 1, "0.58", true);
  createItem(curRow, 2, "0.47", true);
  createItem(curRow, 3, "70", true);
  createItem(curRow, 4, "1,82", true);

  this->setRowHeight(curRow, 25);

//40
  curRow = 39;

  createItem(curRow, 0, tr("Южный склон Большого Кавказа выше 1500м"), false);

  createItem(curRow, 1, "0.57", true);
  createItem(curRow, 2, "0.52", true);
  createItem(curRow, 3, "100", true);
  createItem(curRow, 4, "1,54", true);

  this->setRowHeight(curRow, 25);

//41
  curRow = 40;

  createItem(curRow, 0, tr("Южный склон выше 500м, ДагАССР"), false);

  createItem(curRow, 1, "0.57", true);
  createItem(curRow, 2, "0.52", true);
  createItem(curRow, 3, "100", true);
  createItem(curRow, 4, "1,54", true);

  this->setRowHeight(curRow, 25);

//42
  curRow = 41;

  createItem(curRow, 0, tr("Побережье Черного моря Сухуми"), false);

  createItem(curRow, 1, "0.54", true);
  createItem(curRow, 2, "0.5", true);
  createItem(curRow, 3, "90", true);
  createItem(curRow, 4, "1,33", true);

  this->setRowHeight(curRow, 25);

//43
  curRow = 42;

  createItem(curRow, 0, tr("Колхидская низменность, склоны Кавказа до 2000м"), false);

  createItem(curRow, 1, "0.54", true);
  createItem(curRow, 2, "0.5", true);
  createItem(curRow, 3, "90", true);
  createItem(curRow, 4, "1,33", true);

  this->setRowHeight(curRow, 25);

//44
  curRow = 43;

  createItem(curRow, 0, tr("Бассейн Куры, восточная часть Малого Кавказа"), false);

  createItem(curRow, 1, "0.63", true);
  createItem(curRow, 2, "0.52", true);
  createItem(curRow, 3, "90", true);
  createItem(curRow, 4, "1,33", true);

  this->setRowHeight(curRow, 25);

//45
  curRow = 44;

  createItem(curRow, 0, tr("Талышский хребет"), false);

  createItem(curRow, 1, "0.63", true);
  createItem(curRow, 2, "0.52", true);
  createItem(curRow, 3, "90", true);
  createItem(curRow, 4, "1,33", true);

  this->setRowHeight(curRow, 25);

//46
  curRow = 45;

  createItem(curRow, 0, tr("Северо-западная и центральная части Армении"), false);

  createItem(curRow, 1, "0.67", true);
  createItem(curRow, 2, "0.53", true);
  createItem(curRow, 3, "100", true);
  createItem(curRow, 4, "1,33", true);

  this->setRowHeight(curRow, 25);

//47
  curRow = 46;

  createItem(curRow, 0, tr("Ленкорань"), false);

  createItem(curRow, 1, "0.44", true);
  createItem(curRow, 2, "0.38", true);
  createItem(curRow, 3, "171", true);
  createItem(curRow, 4, "2.2", true);

  this->setRowHeight(curRow, 25);


//Сигналы выделения элемента
  connect(this, SIGNAL(cellClicked(int, int)), this, SLOT(selectCell(int, int)));
  connect(this, SIGNAL(cellActivated(int, int)), this, SLOT(selectCellAndClose(int, int)));

} //RegionDialog::RegionDialog(QWidget *parent) : QWidget(parent)

bool RegionDialog::createItem(int row, int column, const QString & str, bool center) {

  if ((row < MAXITEMS) && (column < MAXITEMS)) {

    item = new QLabel();
    item->setAutoFillBackground(true);
    item->setText(str);
    item->setIndent(ITEMINDENT);
    if (center)
      item->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
    this->setCellWidget(row, column, item);
    items[row][column] = item;
    setDefColor(row, column);

    return true;
    
  } //if ((row < MAXITEMS) && (column < MAXITEMS))

  else {

    return false;

  } //else: if ((row < MAXITEMS) && (column < MAXITEMS))

} //bool RegionDialog::createItem(int row, int column, const QString & str, bool center)

void RegionDialog::selectCell(int row, int ) {

  int red   = 200;
  int green = 200;
  int blue  = 230;

  resetSel();
  setColor(QColor(red, green, blue), row, 0);
  setColor(QColor(red, green, blue), row, 1);
  setColor(QColor(red, green, blue), row, 2);
  setColor(QColor(red, green, blue), row, 3);
  setColor(QColor(red, green, blue), row, 4);

  int num = row;

//   switch (row) {

//     case 0:          num =  0; break;
//     case 1:          num =  1; break;
//     case 2:          num =  2; break;
//     case 3:          num =  3; break;
//     case 4:          num =  4; break;
//     case 5:          num =  5; break;
//     case 6:          num =  6; break;
//     case 7:          num =  7; break;
//     case 8:          num =  8; break;
//     case 9:          num =  9; break;
//     case 10:	     num =  10; break;
//     case 11:	     num =  11; break;
//     case 12:	     num =  9; break;
//     case 13:         num = 10; break;
//     case 14:         num = 10; break;
//     case 15:         num = 11; break;
//     case 16:         num = 12; break;
//     case 17:         num = 13; break;
//     case 18:         num = 14; break;
//     case 19:         num = 15; break;
//     case 20:         num = 16; break;
//     case 21:         num = 17; break;
//     case 22:  	     num = 18; break;
//     case 23:         num = 19; break;
//     case 24:         num = 19; break;
//     case 25:	     num = 20; break;
//     case 26:	     num = 20; break;
//     case 27: 	     num = 21; break;
//     case 28: 	     num = 22; break;
//     case 29: 	     num = 23; break;
//     case 30: 	     num = 24; break;
//     case 31:         num = 25; break;
//     case 32:         num = 25; break;
//     case 33: 	     num = 26; break;
//     case 34: 	     num = 27; break;
//     case 35:         num = 28; break;
//     case 36:         num = 28; break;
//     case 37: 	     num = 29; break;
//     case 38:         num = 30; break;
//     case 39:         num = 30; break;
//     case 40:         num = 31; break;
//     case 41:         num = 31; break;
//     case 42:         num = 32; break;
//     case 43:         num = 32; break;
//     case 44:         num = 33; break;
//     case 45:         num = 33; break;
//     case 46: 	     num = 34; break;
//     case 47: 	     num = 35; break;

//   } //switch (row)

  emit selectClass(num+1);

  curSelRow = row;

} //void RegionDialog::selectCell(int row, int column)

void RegionDialog::selectCellAndClose(int row, int ) {

  selectCell(row, 0);

  this->close();

} //void RegionDialog::selectCellAndClose(int row, int column)

void RegionDialog::setColor(const QColor & color, int row, int column) {

  palette.setColor(QPalette::Base, color); 
  items[row][column]->setPalette(palette);

} //void RegionDialog::setColor(const QColor & color, int num)

void RegionDialog::setDefColor(int row, int column) {

  if (row % 2 == 0)
    setColor(QColor(240, 240, 240), row, column);
  else
    setColor(QColor(230, 230, 230), row, column);

} //void RegionDialog::setDefColor(int num)

void RegionDialog::resetSel() {

  curSelRow = -1;

  for (int i=0; i < MAXITEMS; i++)
    for (int j=0; j < MAXITEMS; j++)
      if (items[i][j] != NULL)
	setDefColor(i, j);

} //void RegionDialog::resetSel()

void RegionDialog::keyPressEvent(QKeyEvent * event) {

  if (event->key() == Qt::Key_Up) {
  
    if (curSelRow > 0)
      selectCell(curSelRow-1, 0);
    else
      selectCell(0, 0);

  } //if (event->key() == Qt::Key_Up)  

  else if (event->key() == Qt::Key_Down) {

    if (curSelRow < 46)
      selectCell(curSelRow+1, 0);

  } //else if (event->key() == Qt::Key_Down)

  else if (event->key() == Qt::Key_Return) {

    if (curSelRow != -1)
      selectCellAndClose(curSelRow, 0);

  } //else if (event->key() == Qt::Key_Return)

  else if (event->key() == Qt::Key_Escape) {

    this->hide();

  } //else if (event->key() == Qt::Key_Return)

} //void RegionDialog::keyPressEvent(QKeyEvent * event)
